#!/bin/sh

check_process_number(){
    if [ $# -eq 1 ] ; then
        local process_name=$1
        local process_num=`ps ax | grep $process_name | grep -v grep | wc -l`
        return $(($process_num-2))
    else    
        echo "[check_process_number] WARN: Error argrument!"
        return 0
    fi      
}

##################################################

check_process_number $1
num=$?
if [ $num -gt 0 ] ; then
    echo "$num processs [$1] has found"
else    
    echo "not found."
fi
